<% if matches.score_a.nil? || matches.score_b.nil? %>
  <div class="match overdue" id="match_<%= matches.id %>">
<% else %>
  <div class="match" id="match_<%= matches.id %>">
<% end -%>
    <%= image_tag '/images/sport_raquet.png' %>
    <div id="names" class="cell"><%= matches.user.login %> VS <%= User.find(matches.oponent_id).login %></div>
    <div id="date" class="cell"><%= matches.date.to_formatted_s(:long)  %></div>
    <% if matches.score_a.nil? || matches.score_b.nil? %>
      <div id="score" class="cell"><%= link_to 'Add Scores', :controller => 'matches', :action => 'create_scores', :id => matches %></div>
    <% else %>
      <div id="score" class="cell">Score: <%= matches.score_a.to_s + ':' + matches.score_b.to_s %></div>
    <% end -%>
    <div id="links" class="cell"><%= link_to 'Cancel', matches, :confirm => 'Are you sure?', :method => :delete %></div>
  </div>